/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gameEngine;

import java.lang.Math;

/**
 *
 * @author Rémi Dubois <RemiEric.Dubois@gmail.com>
 */
public class Position {
    private int x;
    private int y;
    
    public Position(int x, int y) {
        this.x = x;
        this.y = y;
    }
    
    public Position() {
        this(0, 0);
    }
    
    public Position(Position pos) {
        this(pos.getX(), pos.getY());
    }
    
    /**
     * @return the x
     */
    public int getX() {
        return x;
    }

    /**
     * @param x the x to set
     */
    public void setX(int x) {
        this.x = x;
    }

    /**
     * @return the y
     */
    public int getY() {
        return y;
    }

    /**
     * @param y the y to set
     */
    public void setY(int y) {
        this.y = y;
    }
    
    /**
     * Calcule la distance entre un point et celui ci.
     * Float ou int ?
     */
    public int distance_to (Position P2)
    {
    	return (int) Math.sqrt( Math.pow(x-P2.getX(), 2) + Math.pow(y-P2.getY(), 2) ); 	
    }
    
}
